// pages/userCenter/userCenter.js
const net = require("./net.js")
const event = require("./event.js")
import {getUserInfo} from '../../serve/userCenter'
Page({
  ...net,
  ...event,
  /**
   * 页面的初始数据
   */
  data: {
   userInfo:{},
   list:[
     { name: "成长任务", src: "https://static.dingtalk.com/media/lALPDetfdBGxtUXMjMyM_140_140.png", openType:""},
     { name: "推广佣金", src: "https://static.dingtalk.com/media/lALPDetfdBGorg7MjMyM_140_140.png", openType: "" },
   
     { name: "使用攻略", src: "https://static.dingtalk.com/media/lALPDfJ6cVsx4kHMjMyM_140_140.png", openType: "" },
     { name: "客户服务", src: "https://static.dingtalk.com/media/lALPDeC2-CNeFinMjMyM_140_140.png", openType:"contact"},
   ],
    goodsList: [], // 商家自营
    noMore: false,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
 
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.getUserInfo()
   
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  getUserInfo(){
    getUserInfo({}).then(res=>{
        this.setData({
          userInfo:res.result
        })
    })
  },
})